<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
//use think\Controller;
class Login extends Controller{
	public function index(){
		if(request()->isPost()){

			$name=input('param.username');
			$pwd=input('param.password');
			$date=Db::table('admin')->where('username',$name)->where('password',$pwd)->find();
			if(count($date)>0){
				session('username',$name);
				//$this->success('登陆成功','index/index');
				$this->redirect('index/index');
			}

		}
		else{
			return view('index');
		}
	}
}
?>
